<template>
  <div class="adminqianming">
    <admin_top></admin_top>
    <div style="padding: 0 20px;">
      <el-table :data="tableData" style="text-align: center;" align="center" border :loading="loading">
        <el-table-column label="店铺">
          <template slot-scope="scope">
            <span>{{ scope.row.name }}</span>
          </template>
        </el-table-column>
        <el-table-column label="营业执照">
          <template slot-scope="scope">
            <img :src="scope.row.agree" style="width: 100%;" />
          </template>
        </el-table-column>

        <el-table-column label="服务协议">
          <template slot-scope="scope">
            <img :src="scope.row.permit" style="width: 100%;" />
          </template>
        </el-table-column>

        <el-table-column label="创建时间">
          <template slot-scope="scope">
            <span>{{ scope.row.created_at }}</span>
          </template>
        </el-table-column>
        <el-table-column label="操作">
          <template slot-scope="scope">
            <el-button type="text" @click="shenhe(1,scope.row.shop_id)">审核通过</el-button>
            <el-button type="text" @click="shenhe(2,scope.row.shop_id)">审核拒绝</el-button>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </div>
</template>

<script>
  import admin_top from './top.vue';
  import axios from 'axios'
  export default {
    components: {
      admin_top
    },
    name: 'adminqianming',
    data() {
      return {
        all: {
          pagesize: 20,
          page: 1,
        },
        tableData: "",
        total: "",
        loading: true
      }
    },
    watch: {

    },
    computed: {

    },
    created() {
      this.getlist()
    },
    methods: {
      shenhe: function(status, shop_id) {

        axios.post('/api/plan-market/message/qualifications/review', {
            status: status,
            shop_id: shop_id
          })
          .then(response => {
            if (response.data.msg.code == 0) {
              this.$message.success('已处理');
              this.getlist()
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      },
      //翻页
      fanye: function(page) {
        this.loading = true
        this.all.page = page
        this.getlist()
      },
      //获取全部
      getlist: function() {
        var that = this
        axios.get('/api/plan-market/message/qualifications/list')
          .then(response => {
            if (response.data.msg.code == 0) {
              this.tableData = response.data.data

              this.loading = false
            } else {
              this.$message.error(response.data.msg.info);
            }
          })
      },

    },

  }
</script>

<style scoped>
  .adminqianming {
    background: #EAEAEA;
    min-height: 100vh;
    padding: 0px;
  }
</style>
